#include<iostream>
using namespace std;
#include<vector>
#include<algorithm>
class Solution {
public:
    vector<int> singleNumber(vector<int>& nums) {
        sort(nums.begin(), nums.end());
        int n = nums.size();
        vector<int> ret = {0,0};
       
        int left = 0, i = 0;
        

        while (left < n-1)
        {
            if (nums[left] == nums[left+1])
            {
                left += 2;
                
            }
            else
            {
                ret[i++] = nums[left];
                left++;
            }
        }
        if (nums[n - 1] != nums[n - 2]) {
            ret[i++] = nums[n - 1];
        }

      
        return ret;
    }
};

int main()
{
    vector<int> a = { 1, 2, 1, 3, 2, 5 };
    Solution s;
    s.singleNumber(a);
    return 0;
}